<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>npyscreen.password</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="npyscreen-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="npyscreen-module.html">Package&nbsp;npyscreen</a> ::
        Module&nbsp;password
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="npyscreen.password-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="npyscreen.password-module.html">Module npyscreen.password</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-comment">#!/usr/bin/python</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-keyword">import</tt> <tt class="py-name">curses</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Module npyscreen.textbox=npyscreen.textbox-module.html"><a title="npyscreen.textbox" class="py-name" href="#" onclick="return doclink('link-0', 'textbox', 'link-0');">textbox</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Class npyscreen.textbox.Textfield=npyscreen.textbox.Textfield-class.html"><a title="npyscreen.textbox.Textfield" class="py-name" href="#" onclick="return doclink('link-1', 'Textfield', 'link-1');">Textfield</a></tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Module npyscreen.titlefield=npyscreen.titlefield-module.html"><a title="npyscreen.titlefield" class="py-name" href="#" onclick="return doclink('link-2', 'titlefield', 'link-2');">titlefield</a></tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"> </tt>
<a name="PasswordEntry"></a><div id="PasswordEntry-def"><a name="L7"></a><tt class="py-lineno"> 7</tt> <a class="py-toggle" href="#" id="PasswordEntry-toggle" onclick="return toggle('PasswordEntry');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="npyscreen.password.PasswordEntry-class.html">PasswordEntry</a><tt class="py-op">(</tt><tt class="py-base-class">Textfield</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PasswordEntry-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="PasswordEntry-expanded"><a name="PasswordEntry._print"></a><div id="PasswordEntry._print-def"><a name="L8"></a><tt class="py-lineno"> 8</tt> <a class="py-toggle" href="#" id="PasswordEntry._print-toggle" onclick="return toggle('PasswordEntry._print');">-</a><tt class="py-line">        <tt class="py-keyword">def</tt> <a class="py-def-name" href="npyscreen.password.PasswordEntry-class.html#_print">_print</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="PasswordEntry._print-collapsed" style="display:none;" pad="++" indent="++++++++++++"></div><div id="PasswordEntry._print-expanded"><a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line">                <tt class="py-name">strlen</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Variable npyscreen.slider.Slider.value=npyscreen.slider.Slider-class.html#value,Variable npyscreen.titlefield.TitleText.value=npyscreen.titlefield.TitleText-class.html#value"><a title="npyscreen.slider.Slider.value
npyscreen.titlefield.TitleText.value" class="py-name" href="#" onclick="return doclink('link-3', 'value', 'link-3');">value</a></tt><tt class="py-op">)</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">maximum_string_length</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">strlen</tt><tt class="py-op">:</tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line">                        <tt class="py-name">tmp_x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">relx</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line">                        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">maximum_string_length</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line">                                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">parent</tt><tt class="py-op">.</tt><tt class="py-name">curses_pad</tt><tt class="py-op">.</tt><tt class="py-name">addch</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rely</tt><tt class="py-op">,</tt> <tt class="py-name">tmp_x</tt><tt class="py-op">,</tt> <tt class="py-string">'-'</tt><tt class="py-op">)</tt>  </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line">                                <tt class="py-name">tmp_x</tt> <tt class="py-op">+=</tt> <tt class="py-number">1</tt> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line"> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line">                        <tt class="py-name">tmp_x</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">relx</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line">                        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">strlen</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line">                                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">parent</tt><tt class="py-op">.</tt><tt class="py-name">curses_pad</tt><tt class="py-op">.</tt><tt class="py-name">addstr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">rely</tt><tt class="py-op">,</tt> <tt class="py-name">tmp_x</tt><tt class="py-op">,</tt> <tt class="py-string">'-'</tt><tt class="py-op">)</tt>  </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line">                                <tt class="py-name">tmp_x</tt> <tt class="py-op">+=</tt> <tt class="py-number">1</tt> </tt>
</div></div><a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line"> </tt>
<a name="TitlePassword"></a><div id="TitlePassword-def"><a name="L22"></a><tt class="py-lineno">22</tt> <a class="py-toggle" href="#" id="TitlePassword-toggle" onclick="return toggle('TitlePassword');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="npyscreen.password.TitlePassword-class.html">TitlePassword</a><tt class="py-op">(</tt><tt class="py-base-class">titlefield</tt><tt class="py-op">.</tt><tt class="py-base-class">TitleText</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TitlePassword-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="TitlePassword-expanded"><a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line">        <tt class="py-name">_entry_type</tt> <tt class="py-op">=</tt> <tt id="link-4" class="py-name" targets="Class npyscreen.password.PasswordEntry=npyscreen.password.PasswordEntry-class.html"><a title="npyscreen.password.PasswordEntry" class="py-name" href="#" onclick="return doclink('link-4', 'PasswordEntry', 'link-4');">PasswordEntry</a></tt> </tt>
</div><a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line"> </tt>
<a name="testloop"></a><div id="testloop-def"><a name="L25"></a><tt class="py-lineno">25</tt> <a class="py-toggle" href="#" id="testloop-toggle" onclick="return toggle('testloop');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="npyscreen.password-module.html#testloop">testloop</a><tt class="py-op">(</tt><tt class="py-param">sa</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="testloop-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="testloop-expanded"><a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line">        <tt class="py-name">SA</tt> <tt class="py-op">=</tt> <tt id="link-5" class="py-name" targets="Module npyscreen.screen_area=npyscreen.screen_area-module.html"><a title="npyscreen.screen_area" class="py-name" href="#" onclick="return doclink('link-5', 'screen_area', 'link-5');">screen_area</a></tt><tt class="py-op">.</tt><tt id="link-6" class="py-name" targets="Class npyscreen.screen_area.ScreenArea=npyscreen.screen_area.ScreenArea-class.html"><a title="npyscreen.screen_area.ScreenArea" class="py-name" href="#" onclick="return doclink('link-6', 'ScreenArea', 'link-6');">ScreenArea</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line">        <tt class="py-name">w</tt> <tt class="py-op">=</tt> <tt id="link-7" class="py-name" targets="Class npyscreen.password.TitlePassword=npyscreen.password.TitlePassword-class.html"><a title="npyscreen.password.TitlePassword" class="py-name" href="#" onclick="return doclink('link-7', 'TitlePassword', 'link-7');">TitlePassword</a></tt><tt class="py-op">(</tt><tt class="py-name">SA</tt><tt class="py-op">)</tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line">        <tt class="py-name">w</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Method npyscreen.ActionForm.ActionForm.edit()=npyscreen.ActionForm.ActionForm-class.html#edit,Method npyscreen.Form.Form.edit()=npyscreen.Form.Form-class.html#edit,Method npyscreen.Menu.Menu.edit()=npyscreen.Menu.Menu-class.html#edit,Method npyscreen.NMenuDisplay.MenuDisplay.edit()=npyscreen.NMenuDisplay.MenuDisplay-class.html#edit,Method npyscreen.combobox.ComboBox.edit()=npyscreen.combobox.ComboBox-class.html#edit,Method npyscreen.datecombo.DateCombo.edit()=npyscreen.datecombo.DateCombo-class.html#edit,Method npyscreen.multiline.MultiLine.edit()=npyscreen.multiline.MultiLine-class.html#edit,Method npyscreen.multiline.Pager.edit()=npyscreen.multiline.Pager-class.html#edit,Method npyscreen.textbox.FixedText.edit()=npyscreen.textbox.FixedText-class.html#edit,Method npyscreen.textbox.Textfield.edit()=npyscreen.textbox.Textfield-class.html#edit,Method npyscreen.titlefield.TitleText.edit()=npyscreen.titlefield.TitleText-class.html#edit,Method npyscreen.widget.Widget.edit()=npyscreen.widget.Widget-class.html#edit"><a title="npyscreen.ActionForm.ActionForm.edit
npyscreen.Form.Form.edit
npyscreen.Menu.Menu.edit
npyscreen.NMenuDisplay.MenuDisplay.edit
npyscreen.combobox.ComboBox.edit
npyscreen.datecombo.DateCombo.edit
npyscreen.multiline.MultiLine.edit
npyscreen.multiline.Pager.edit
npyscreen.textbox.FixedText.edit
npyscreen.textbox.Textfield.edit
npyscreen.titlefield.TitleText.edit
npyscreen.widget.Widget.edit" class="py-name" href="#" onclick="return doclink('link-8', 'edit', 'link-8');">edit</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line"> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line"> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">"__main__"</tt><tt class="py-op">:</tt> </tt>
<a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt class="py-name">curses</tt><tt class="py-op">.</tt><tt class="py-name">wrapper</tt> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt id="link-9" class="py-name"><a title="npyscreen.screen_area" class="py-name" href="#" onclick="return doclink('link-9', 'screen_area', 'link-5');">screen_area</a></tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line">        <tt class="py-name">curses</tt><tt class="py-op">.</tt><tt class="py-name">wrapper</tt><tt class="py-op">(</tt><tt id="link-10" class="py-name" targets="Function npyscreen.password.testloop()=npyscreen.password-module.html#testloop,Function npyscreen.titlefield.testloop()=npyscreen.titlefield-module.html#testloop"><a title="npyscreen.password.testloop
npyscreen.titlefield.testloop" class="py-name" href="#" onclick="return doclink('link-10', 'testloop', 'link-10');">testloop</a></tt><tt class="py-op">)</tt> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line">        <tt class="py-keyword">print</tt> <tt class="py-string">"When I wrote you, I had much to learn"</tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="npyscreen-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Thu Mar 29 15:58:55 2007
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
